/*
 * @(#)AccountService.java 1.0 2010-3-8
 *
 * Copyright 2009 NetQin , Inc. All rights reserved.
 */
package com.netgo.service;

import com.netgo.account.Account;
import com.netgo.common.constant.Constants;
import com.netgo.dao.AccountDao;

/**
 * @author wangajing
 * @version 1.0,2010-3-8
 * @see
 * @since 1.0 
 *
 */
public class AccountService extends BasicService{
	private AccountDao accountDao;
	
	public AccountDao getAccountDao() {
		return accountDao;
	}

	public void setAccountDao(AccountDao accountDao) {
		this.accountDao = accountDao;
	}

	public void regService(Account account){
		account.setAccoutStatus(Account.STATUS_UN_CHECK);
		accountDao.addAccount(account);
		if(account.getAccountID()!=0){
			sendEmail(account);
		}
		
	}

	/**
	 * @param account
	 */
	private void sendEmail(Account account) {
		String subject = utilService.getRuleValue("RULE_REG_EMAIL_TITLE");
		if(subject==null){
			subject = Constants.EMAIL_TITLE;
		}
		String content = "你好，欢迎您注册NETGO，中国最大的网购市场。\n"+
		"请确认一下内容："+
		"注册名："+account.getAccountName()+
		"注册密码："+account.getPassword()+
		"点击一下链接完成邮箱的注册";
		
		
		
		
	}
}
